# -*- mode: python ; coding: utf-8 -*-

import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)

a = Analysis(
    ['main.py'],
    pathex=[],
    binaries=[],
    datas=[
        ('config', 'config'),
        ('images', 'images'),
        ('logs', 'logs'),
        ('ocr_results', 'ocr_results'),
        # futu库必需的数据文件
        ('D:\\kaifa\\env\\conda1\\Lib\\site-packages\\futu\\VERSION.txt', 'futu'),
        ('D:\\kaifa\\env\\conda1\\Lib\\site-packages\\futu\\common\\conn_key.txt', 'futu\\common'),
        ('D:\\kaifa\\env\\conda1\\Lib\\site-packages\\futu\\tools\\Common.proto.json', 'futu\\tools'),
        ('D:\\kaifa\\env\\conda1\\Lib\\site-packages\\futu\\tools\\rst_template.txt', 'futu\\tools'),
        ('D:\\kaifa\\env\\conda1\\Lib\\site-packages\\futu\\tools\\template_code.txt', 'futu\\tools'),
        ('D:\\kaifa\\env\\conda1\\Lib\\site-packages\\futu\\tools\\template_head.txt', 'futu\\tools'),
    ],
    hiddenimports=[
        # 项目内部模块
        'gui.main_window',
        'gui.config_panel', 
        'gui.log_panel',
        'gui.area_selector',
        'trading.futu_trader',
        'trading.order_manager',
        'utils.config_manager',
        'utils.logger',
        'database.market_database',
        'ocr.ocr_service',
        'broker_account_scanner',
        'api_analysis',
        'detailed_account_analysis', 
        'position_price_solution',
        # 富途API相关
        'futu',
        'futu.trade',
        'futu.quote',
        'futu.common',
        'futu.trade_context',
        'futu.quote_context', 
        'futu.common.constant',
        'futu.common.pb',
        'futu.common.utils',
        'futu.trade.trade_query',
        'futu.trade.trade_deal',
        # PyQt5相关
        'PyQt5.QtCore',
        'PyQt5.QtGui', 
        'PyQt5.QtWidgets',
        # 其他依赖
        'requests',
        'json',
        'sqlite3',
        'threading',
        'datetime',
        'logging',
        'configparser',
        'time',
        'socket',
        'subprocess',
        'sys',
        'os',
        'pathlib',
        'typing',
        'collections',
        'traceback',
        'functools',
        'base64',
        'hashlib',
        'uuid',
        'copy',
        're',
        'math',
        'decimal',
    ],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=['PyQt6', 'PyQt6.QtCore', 'PyQt6.QtGui', 'PyQt6.QtWidgets'],
    noarchive=False,
    optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    [],
    name='main',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)
